-
Notifications
You must be signed in to change notification settings - Fork 58
Backup strategy using pg-dump #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Install v13 by default - Disable repo 'AppStream' during pkg install on RH-8
…sion of PG (currently 13, as per 9425bbe)
I am pinging Sj. Let's wait for a comment from him |
As far as I can see #30 is about the WAL-archiving backup method; at usegalaxy.eu we have been using plain old DB dumps (using pg_dumpall(1)) ever since we started the site and I prefer sticking with that method for the time being, mainly because I have no practical experience with WAL-archiving. Given the current (and ever growing) size of the database we might one day need to reconsider but for the moment I just wanted to carry our status quo over to the new server instance. I didn't rly intend to push the PR upstream either, that's why I closed my first PR when I realized it had propagated upward. Of course, we should merge the fixes for WAL-archiving from 'galaxyproject' into 'usegalaxy.eu', for possible future use. |
Fair enough! I'll give this a whirl and merge it. Thanks for upstreaming it though, we definitely appreciate it! A traditional pg_dumpall is still a fantastic option for a lot of smaller servers (and bigger ones too!) |
@@ -1,6 +1,9 @@ | |||
--- | |||
|
|||
postgresql_default_version: 10 | |||
postgresql_default_version: 13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@natefoo any issue with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks fine, let's enable it!
|
||
postgresql_pgdump_cronspec: "00 18 * * 1-7" | ||
postgresql_pgdump_filespec: 'full.daily.`/bin/date +"\%u"`.sql' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# postgresql_pgdump_dir: |
I think this needs to be documented somewhere, maybe in the readme?
template: | ||
src: local-pgdump.crontab | ||
dest: /etc/cron.d/local-pgdump | ||
owner: root | ||
group: root | ||
mode: 0644 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do this via the cron module to be a bit more standard
template: | |
src: local-pgdump.crontab | |
dest: /etc/cron.d/local-pgdump | |
owner: root | |
group: root | |
mode: 0644 | |
- name: Creates a cron file under /etc/cron.d | |
ansible.builtin.cron: | |
name: Regular pgdump | |
month: "{{ postgresql_pgdump_cron_month | default(omit) }}" | |
weekday: "{{ postgresql_pgdump_cron_weekday | default(omit) }}" | |
day: "{{ postgresql_pgdump_cron_day | default(omit) }}" | |
minute: "{{ postgresql_pgdump_cron_minute | default(omit) }}" | |
hour: "{{ postgresql_pgdump_cron_hour | default(omit) }}" | |
user: "{{ postgresql_user_name }}" | |
job: "{{ postgresql_inst_dir_default }}/bin/pg_dumpall -c -f {{ postgresql_pgdump_dir }}/{{ postgresql_pgdump_filespec }}" | |
cron_file: ansible_local-pgdump |
@@ -30,3 +33,7 @@ postgresql_backup_command: >- | |||
--keep {{ postgresql_backup_keep | quote }} | |||
{{ '--pg-bin-dir ' ~ __postgresql_pgdg_bin_dir if ansible_os_family == 'RedHat' else '' }} | |||
--backup --clean-archive {{ postgresql_backup_dir | quote }} | |||
|
|||
postgresql_pgdump_cronspec: "00 18 * * 1-7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postgresql_pgdump_cronspec: "00 18 * * 1-7" | |
postgresql_pgdump_cron_month: "*" | |
postgresql_pgdump_cron_weekday: "*" | |
# postgresql_pgdump_cron_day: | |
postgresql_pgdump_cron_minute: 0 | |
postgresql_pgdump_cron_hour: 18 |
@@ -0,0 +1 @@ | |||
{{ postgresql_pgdump_cronspec }} {{ postgresql_user_name }} {{ postgresql_inst_dir_default }}/bin/pg_dumpall -c -f {{ postgresql_pgdump_dir }}/{{ postgresql_pgdump_filespec }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now unnecessary
Without this task the repo installation failed during rocky 9 testing
Add install RPM GPG key task to redhat variant
Update postgresql repositry keys for redhat
from @sj213